public class NGuessNumber {
    int [] answers = new int[4];

    public int [] generateAnswers(){
        answers[0] = (int)(Math.random()*100+1);
        int i = 1;
        while (i<4){
            int answer = (int)(Math.random()*100+1);
            boolean same = false;
            int j = 0;
            while (j < i){
                if (answer == answers[j]){
                    same = true;
                    break;
                }
                j = j + 1 ;
            }
            if (!same){
                answers[j] = answer;
                i = i + 1;
            }
        }
        return answers;
    }

    public static void main(String[] args) {
        NGuessNumber ngn = new NGuessNumber();
        ngn.generateAnswers();
        int [] answers = ngn.generateAnswers();
        for (int i = 0;i<answers.length;i++){
            System.out.println(answers[i]);
        }
    }

}